package com.ccp.dev.system.model;

import com.ccp.dev.core.basic.api.ISysDataSource;
import com.ccp.dev.core.basic.model.BaseModel;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

/**
 * SYS_DATA_SOURCE Model对象
 *
 * @author zhaowj
 */
@XmlRootElement(name = "dataSource")
@XmlAccessorType(XmlAccessType.NONE)
public class SysDataSource extends BaseModel<SysDataSource> implements ISysDataSource {

    /**
     * 主键
     */
    @XmlElement
    protected String id;

    /**
     * 名称
     */
    @XmlElement
    protected String name;

    /**
     * 别名
     */
    @XmlElement
    protected String alias;

    /**
     * 数据源的类型-mysql,oracle,sqlserver
     */
    @XmlElement
    protected String dbType;

    /**
     * 设置字段
     */
    @XmlElement
    protected String settingJson;

    /**
     * 开始服务器时启动
     */
    @XmlElement
    protected Boolean initOnStart;

    /**
     * 是否可用
     */
    @XmlElement
    protected Boolean enabled;

    /**
     * 类路径
     */
    @XmlElement
    protected String classPath;

    /**
     * 初始化方法
     */
    @XmlElement
    protected String initMethod;

    /**
     * 关闭方法
     */
    @XmlElement
    protected String closeMethod;

    protected Long runId = 0L;
    @Override
    public String getId() {
        return id;
    }
    @Override
    public void setId(String id) {
        this.id = id;
    }
    @Override
    public String getName() {
        return name;
    }
    @Override
    public void setName(String name) {
        this.name = name;
    }
    @Override
    public String getAlias() {
        return alias;
    }
    @Override
    public void setAlias(String alias) {
        this.alias = alias;
    }
    @Override
    public String getDbType() {
        return dbType;
    }
    @Override
    public void setDbType(String dbType) {
        this.dbType = dbType;
    }
    @Override
    public String getSettingJson() {
        return settingJson;
    }
    @Override
    public void setSettingJson(String settingJson) {
        this.settingJson = settingJson;
    }
    @Override
    public Boolean getInitOnStart() {
        return initOnStart;
    }
    @Override
    public void setInitOnStart(Boolean initOnStart) {
        this.initOnStart = initOnStart;
    }
    @Override
    public Boolean getEnabled() {
        return enabled;
    }
    @Override
    public void setEnabled(Boolean enabled) {
        this.enabled = enabled;
    }
    @Override
    public String getClassPath() {
        return classPath;
    }
    @Override
    public void setClassPath(String classPath) {
        this.classPath = classPath;
    }
    @Override
    public String getInitMethod() {
        return initMethod;
    }
    @Override
    public void setInitMethod(String initMethod) {
        this.initMethod = initMethod;
    }
    @Override
    public String getCloseMethod() {
        return closeMethod;
    }
    @Override
    public void setCloseMethod(String closeMethod) {
        this.closeMethod = closeMethod;
    }
    @Override
    public void setRunId(Long runId) {
        this.runId = runId;
    }
    @Override
    public Long getRunId() {
        return runId;
    }

    @Override
    public String toString() {
        return "SysDataSource{" +
                "id='" + id + '\'' +
                ", name='" + name + '\'' +
                ", alias='" + alias + '\'' +
                ", dbType='" + dbType + '\'' +
                ", settingJson='" + settingJson + '\'' +
                ", initOnStart=" + initOnStart +
                ", enabled=" + enabled +
                ", classPath='" + classPath + '\'' +
                ", initMethod='" + initMethod + '\'' +
                ", closeMethod='" + closeMethod + '\'' +
                '}';
    }
}